$(document).ready(function() {
				$(window).scroll(function() {
					var items = $("#content").find(".item");
					var menu = $("#menu");
					var top = $(document).scrollTop();
					var currentId = ""; //滚动条现在所在位置的item id
					items.each(function() {
						var m = $(this);
						//注意：m.offset().top代表每一个item的顶部位置
						if (top > m.offset().top - 300) {
							currentId = "#" + m.attr("id");
						} else {
							return false;
						}
					});
					var currentLink = menu.find(".current");
					if (currentId && currentLink.attr("href") != currentId) {
						currentLink.removeClass("current");
						menu.find("[href=" + currentId + "]").addClass("current");
					}
				});
				colHeight = document.documentElement.clientHeight;
				document.getElementById("menu").style.height = colHeight + "px";
				$('#doc-prompt-toggle').on('click', function() {
					$('#my-prompt').modal({
						relatedTarget: this,
						onConfirm: function(e) {
							if (e.data) {
								$("#menu ul").append("<li><a href='#" + e.data + "'>" + e.data + "</a></li>");
								var newContent = "<div id='" + e.data + "' class='item item_new'><h2>" + e.data + "</h2><a class='am-btn am-btn-success new-btn'><i class='am-icon-plus'></i>&nbsp;新增商品</a></div>"
								$("#content").find("#saveBtn").before(newContent);
								// $("item_new").css("height",colHeight);
							}
						},
						onCancel: function(e) {
							return false;
						}
					});
				});
			});